﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Light.Framework.Model;
using Castle.ActiveRecord;

namespace Light.Coin.Model
{
    /// <summary>
    /// 签到日志
    /// </summary>
    [ActiveRecord]
    public class SignLog : Entity
    {
        public SignLog()
        {
            LastDays = 1;
        }

        [BelongsTo("User_ID", Cascade = CascadeEnum.SaveUpdate)]
        public User User
        {
            get;
            set;
        }

        /// <summary>
        /// 连续签到天数
        /// </summary>
        [Property]
        public int LastDays
        {
            get;
            set;
        }

        /// <summary>
        /// 签到获取的积分数
        /// </summary>
        [Property]
        public int Coins { get; set; }

        protected override void ValidateRules()
        {
            AddValidateRules(User != null, "用户不能为空");
        }
    }
}
